project(audio-coding)

file(GLOB audio_coding_sources ${CMAKE_CURRENT_SOURCE_DIR}/*.h
        ${CMAKE_CURRENT_SOURCE_DIR}/cng/*.h
        ${CMAKE_CURRENT_SOURCE_DIR}/isac/*.h
        ${CMAKE_CURRENT_SOURCE_DIR}/isac/main/include/*.h)

list(APPEND audio_coding_sources
        ## isac_vad_sources
        "codecs/isac/main/source/filter_functions.c"
        "codecs/isac/main/source/isac_vad.c"
        "codecs/isac/main/source/pitch_estimator.c"
        "codecs/isac/main/source/pitch_filter.c"
        ## webrtc_audio_coding_sources
        "codecs/isac/main/source/arith_routines.c"
        "codecs/isac/main/source/arith_routines_hist.c"
        "codecs/isac/main/source/arith_routines_logist.c"
        "codecs/isac/main/source/audio_decoder_isac.cc"
        "codecs/isac/main/source/audio_encoder_isac.cc"
        "codecs/isac/main/source/bandwidth_estimator.c"
        "codecs/isac/main/source/crc.c"
        "codecs/isac/main/source/decode_bwe.c"
        "codecs/isac/main/source/decode.c"
        "codecs/isac/main/source/encode.c"
        "codecs/isac/main/source/encode_lpc_swb.c"
        "codecs/isac/main/source/entropy_coding.c"
        "codecs/isac/main/source/filterbanks.c"
        "codecs/isac/main/source/intialize.c"
        "codecs/isac/main/source/isac.c"
        "codecs/isac/main/source/lattice.c"
        "codecs/isac/main/source/lpc_analysis.c"
        "codecs/isac/main/source/lpc_gain_swb_tables.c"
        "codecs/isac/main/source/lpc_shape_swb12_tables.c"
        "codecs/isac/main/source/lpc_shape_swb16_tables.c"
        "codecs/isac/main/source/lpc_tables.c"
        "codecs/isac/main/source/pitch_gain_tables.c"
        "codecs/isac/main/source/pitch_lag_tables.c"
        "codecs/isac/main/source/spectrum_ar_model_tables.c"
        "codecs/isac/main/source/transform.c"
        )

add_library(${PROJECT_NAME} ${LIB_TYPE} ${audio_coding_sources})
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../../webrtc)
target_compile_definitions(${PROJECT_NAME} PUBLIC WEBRTC_APM_DEBUG_DUMP=1)

target_link_libraries(${PROJECT_NAME} PUBLIC rtc-base webrtc-api common-audio system-wrappers fft)